﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin2.master" AutoEventWireup="true" CodeFile="CustomerManager.aspx.cs" Inherits="Admin_CustomerManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
			
				
		
			
			
			
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel4" runat="server">
        <ContentTemplate>
            <asp:MultiView ID="MultiView1" runat="server">
                <asp:View ID="View1" runat="server">
                <fieldset>
            <legend style="text-align: center; font-size: 18px; font-weight: bold;color:Black">Quản Lý Khách Hàng </legend><br />
     <div align="center">
     <br />
     <div align="center">
        <asp:Label ID="Label2" runat="server" Text="Tìm kiếm"></asp:Label>&nbsp;&nbsp;
        <asp:DropDownList
            ID="DropDownList1" runat="server" AutoPostBack="True" 
             onselectedindexchanged="DropDownList1_SelectedIndexChanged">
             <asp:ListItem Value="1">Số CMND</asp:ListItem>
             <asp:ListItem Value="2">Số điện thoại</asp:ListItem>
             <asp:ListItem Value="3">Tên khách hàng</asp:ListItem>
        </asp:DropDownList>
         <br /><br />
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" value="Chuỗi tìm kiếm" onblur="if (this.value=='') { this.value='Chuỗi tìm kiếm'; }" onfocus="if (this.value=='Chuỗi tìm kiếm') { this.value=''; }" id="txtSoCMND" runat="server" />&nbsp;
         <asp:Button ID="Button1" runat="server" Height="25px" onclick="Button1_Click" 
             Text="Tìm kiếm" ValidationGroup="CMND" Width="90px" />
         <asp:RegularExpressionValidator
                     ID="RegularExpressionValidator2" runat="server" 
             ErrorMessage="Số CMND phải là số có 9 chữ số" ControlToValidate="txtSoCMND" 
             ForeColor="Red" ValidationExpression="\d{9}" ValidationGroup="CMND"></asp:RegularExpressionValidator><asp:RegularExpressionValidator
                     ID="RegularExpressionValidator1" runat="server" 
             ErrorMessage="Số điện thoại phải có 10 hoặc 11 chữ số" ControlToValidate="txtSoCMND" 
             ForeColor="Red" ValidationExpression="\d{10,11}" ValidationGroup="CMND"></asp:RegularExpressionValidator><br /><br /></div>
         <asp:GridView ID="gvKhachHang" runat="server" AutoGenerateColumns="False" 
                         Width="743px" BorderColor="#D2D2D2" 
                        BorderStyle="Solid" BorderWidth="1px" AllowPaging="True" 
                    AllowSorting="True" CellPadding="2" CellSpacing="3" DataKeyNames="TenDangNhap" 
                    PageSize="5" onrowcommand="gvKhachHang_RowCommand" 
             onrowediting="gvKhachHang_RowEditing">
                        <Columns>
                            <asp:BoundField DataField="TenDangNhap" HeaderText="Tên Đăng Nhập" 
                                SortExpression="TenDangNhap" />
                            <asp:BoundField DataField="TenKH" HeaderText="Tên Khách Hàng" 
                                SortExpression="TenKH" />
                            <asp:BoundField HeaderText="Email" DataField="Email" SortExpression="Email" />
                            <asp:BoundField HeaderText="Tổng Số HD" DataField="sohd" 
                                SortExpression="sohd" />
                            <asp:BoundField HeaderText="Tổng Số Tiền" DataField="TongTien" 
                                SortExpression="TongTien" DataFormatString="{0:0,000} VNĐ" />
                            <asp:TemplateField HeaderText="Chọn">
                                <ItemTemplate>
                                <div style="vertical-align:middle;margin-left:10px;">
                                
                                    <asp:LinkButton ID="LinkButton1" CssClass="btnicon1" runat="server" 
                                        CommandName="Edit" ToolTip="Xem chi tiết" 
                                        CommandArgument='<%# Eval("tendangnhap") %>'></asp:LinkButton>
                                    
                                    
                                    </div>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle BackColor="#666666" BorderColor="#D2D2D2" BorderStyle="Solid" 
                            BorderWidth="1px" Font-Bold="True" ForeColor="White" Height="50px" />
                        <PagerStyle CssClass="pagerstyle" />
                        <RowStyle Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />

                    </asp:GridView>
         <br />
         <asp:Label ID="lbKH" runat="server" ForeColor="Red"></asp:Label><br />
         <asp:HiddenField ID="hdTenKH" runat="server" />
                    </div> <br />
                    </fieldset>
                </asp:View>
                <asp:View ID="View2" runat="server">
                <fieldset>
            <legend style="text-align: center; font-size: 18px; font-weight: bold;color:Black">Thông Tin Chi Tiết Khách Hàng </legend><br />
     <div align="center"> <asp:GridView ID="gvChiTietKhangHang" runat="server" AutoGenerateColumns="False" 
                         Width="600px" BorderColor="#D2D2D2" 
                        BorderStyle="Solid" BorderWidth="1px" AllowPaging="True" 
                    AllowSorting="True" CellPadding="2" CellSpacing="3" DataKeyNames="MaHD" 
                    PageSize="5" 
             onpageindexchanging="gvChiTietKhangHang_PageIndexChanging" 
             onrowcommand="gvChiTietKhangHang_RowCommand" 
             onrowediting="gvChiTietKhangHang_RowEditing">
                        <Columns>
                            <asp:BoundField DataField="MaHD" HeaderText="Mã HD" 
                                SortExpression="MaHD"/>
                            <asp:BoundField DataField="NgayLap" HeaderText="Ngày Lập" 
                                SortExpression="NgayLap" DataFormatString="{0:dd/MM/yyyy}" />
                            <asp:BoundField HeaderText="Khách Hàng" DataField="KhachHang" 
                                SortExpression="KhachHang" />
                            <asp:BoundField HeaderText="Tổng Tiền " DataField="tongtien" 
                                SortExpression="tongtien" DataFormatString="{0:0,000} VNĐ" />
                            <asp:BoundField HeaderText="Giảm Giá" DataField="GiamGia" 
                                SortExpression="GiamGia" />
                                <asp:BoundField DataField="ThanhTien" DataFormatString="{0:0,000} VNĐ" 
                                HeaderText="Thành Tiền" />
                                <asp:TemplateField HeaderText="Chọn">
                                <ItemTemplate>
                                <div style="vertical-align:middle;margin-left:10px;">
                                
                                    <asp:LinkButton ID="LinkButton1" CssClass="btnicon1" runat="server" 
                                        CommandName="Edit" ToolTip="Xem chi tiết" 
                                        CommandArgument='<%# Eval("MaHD") %>'></asp:LinkButton>
                                    
                                    
                                    </div>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle BackColor="#666666" BorderColor="#D2D2D2" BorderStyle="Solid" 
                            BorderWidth="1px" Font-Bold="True" ForeColor="White" Height="50px" />
                        <PagerStyle CssClass="pagerstyle" />
                        <RowStyle Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />

                    </asp:GridView>
         <br />
         <asp:Label ID="Label1" runat="server" ForeColor="Red" Text="lbThongTinKH"></asp:Label>
                    </div> <br />
                    </fieldset>
                </asp:View>
                <asp:View ID="View3" runat="server">
                <fieldset>
            <legend style="text-align: center; font-size: 18px; font-weight: bold;color:Black">Thông Tin Chi Tiết Hóa Đơn </legend><br />
     <div align="center"> <asp:GridView ID="gvChiTietHoaDon" runat="server" AutoGenerateColumns="False" 
                         Width="600px" BorderColor="#D2D2D2" 
                        BorderStyle="Solid" BorderWidth="1px" AllowPaging="True" 
                    AllowSorting="True" CellPadding="2" CellSpacing="3" DataKeyNames="mahd,masp" 
                    PageSize="5" 
             onpageindexchanging="gvChiTietHoaDon_PageIndexChanging">
                        <Columns>
                            <asp:BoundField DataField="MaHD" HeaderText="Mã HD" 
                                SortExpression="MaHD" />
                            <asp:BoundField DataField="Tensp" HeaderText="Tên Sản Phẩm" 
                                SortExpression="TenSP" />
                            <asp:BoundField HeaderText="Số Lượng" DataField="SoLuong" 
                                SortExpression="SoLuong" />
                            <asp:BoundField HeaderText="Giá" DataField="Gia" 
                                SortExpression="Gia" DataFormatString="{0:0,000} VNĐ" />
                            <asp:BoundField HeaderText="Thành Tiền" DataField="ThanhTien" 
                                SortExpression="ThanhTien" DataFormatString="{0:0,000} VNĐ" />
                                
                        </Columns>
                        <HeaderStyle BackColor="#666666" BorderColor="#D2D2D2" BorderStyle="Solid" 
                            BorderWidth="1px" Font-Bold="True" ForeColor="White" Height="50px" />
                        <PagerStyle CssClass="pagerstyle" />
                        <RowStyle Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />

                    </asp:GridView>
         <br />
         <asp:Label ID="lbCTHoaDon" runat="server" ForeColor="Red"></asp:Label>
         <asp:HiddenField ID="hdmdhd" runat="server" />
                    </div> <br />
                    </fieldset>
                </asp:View>
            </asp:MultiView>
        
        </ContentTemplate>
        </asp:UpdatePanel>
</asp:Content>

